# 需求分析
# 1 输入珠宝数量
# 2 输入珠宝价值
# 3 初始化展示列表
# 4 对列表排序
# 5 根据规则 输出对应价值值 (不输出位置)、移除已输出值

def jewelry_show_list():
    # 输入珠宝数量
    quantity_Jewelry = int(input("Please Input An Integer: "))
    while quantity_Jewelry < 1 or quantity_Jewelry > 10e5:
        print("Error: Please enter an integer in the required end!"
              "It should be greater than 1(inclusive) & less than 10^5(inclusive).")
        quantity_Jewelry = int(input("Reinput: "))
    # 输入珠宝价值列表
    value_Jewelry = [int(x) for x in input("Please Input An Integer List: ").split(" ")]
    while not all(1 <= value <= 10e9 for value in value_Jewelry):
        print("Error: Please enter an integer list in the required end!"
              "It should be greater than 1(inclusive) & less than 10^9(inclusive).")
        value_Jewelry = [eval(x) for x in input("Reinput List: ").split(" ")]
    value_Jewelry.sort()    # 对价值列表排序
    show_Jewelry = list()   # 初始化展示列表
    len_value = len(value_Jewelry)  # 根据规则 输出对应价值值 (不输出位置)、移除已输出值
    for i in range(len_value):
        # 根据规则确定展示位置
        if len_value % 2 == 1:
            mid_pos = len_value // 2
        else:
            mid_pos = len_value // 2 - 1
        show_Jewelry.append(value_Jewelry[mid_pos])     # 添加进入展示列表
        value_Jewelry.remove(value_Jewelry[mid_pos])    # 移除原表内值
        len_value -= 1  # 重新计算表长
    # result = ' '.join([str(number) for number in show_Jewelry])
    # print("Jewelry Show List: ", result)
    print("Jewelry Show List: ", *show_Jewelry) # 使用解包方法对list型变量show_Jewelry进行解包打印


jewelry_show_list()

